﻿using System;
using System.IO;

namespace LabSolutions
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = null;
            using (StreamReader sr = new StreamReader("input.txt"))
            {
                input = sr.ReadToEnd();
            }
            string[] inputNumbers = input.Split(' ');
            double n = double.Parse(inputNumbers[0]);
            double m = double.Parse(inputNumbers[1]);
            double z1 = ((m - 1) * Math.Sqrt(m) - (n - 1) * Math.Sqrt(n)) / (Math.Sqrt(m * m * m * n) + n * m + m * m - m);
            double z2 = (Math.Sqrt(m) - Math.Sqrt(n)) / m;
            using (StreamWriter sw = new StreamWriter("output.txt"))
            {
                sw.WriteLine(z1.ToString("0.00000"));
                sw.Write(z2.ToString("0.00000"));
            }            
        }
    }
}
